using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;


namespace M13.Base
{
    public class MonoController : MonoBehaviour
    {

        private event UnityAction UpdateEvent;

        void Start()
        {
            DontDestroyOnLoad(this.gameObject);
        }
        void Update()
        {
            if (UpdateEvent != null)
                UpdateEvent.Invoke();
        }
        /// <summary>
        /// ���ⲿ�ṩ������֡�����¼�
        /// </summary>
        /// <param name="fun"></param>
        public void AddUpdateListener(UnityAction fun)
        {
            UpdateEvent += fun;
        }
        /// <summary>
        /// ���ⲿ�ṩ���Ƴ�֡�����¼�
        /// </summary>
        /// <param name="fun"></param>
        public void DeleteUpdateListener(UnityAction fun)
        {
            UpdateEvent -= fun;
        }
    }

}
